from alg import Solution
from gen import generate_test_cases
import time

def run_tests():
    """运行测试用例"""
    solution = Solution()
    test_cases = generate_test_cases()
    
    print("开始测试...")
    print("-" * 50)
    
    for i, test_case in enumerate(test_cases, 1):
        print(f"\n测试用例 {i}:")
        print(f"输入: s = {test_case}")
        
        # 记录开始时间
        start_time = time.time()
        
        # 运行算法
        result = solution.partition(test_case)
        
        # 计算运行时间
        end_time = time.time()
        execution_time = (end_time - start_time) * 1000  # 转换为毫秒
        
        print(f"输出: {result}")
        print(f"运行时间: {execution_time:.2f}ms")
        print(f"分割方案数量: {len(result)}")
        print("-" * 50)

if __name__ == "__main__":
    run_tests() 